/**
 * 组织 模块的api
 */
import request from '@/utils/request'

// 获取组织架构的数据
export function getDepartments() {
    return request({
        url: '/company/department'
    })
}

// 删除部门的接口
export function deleteDepartmentById(id) {
    // 符合 restful 接口规范
    return request({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}
// 添加部门
export function addDepartment(data) {
    return request({
        url: '/company/department',
        method: 'post',
        data,
    })
}
// 根据id获取部门详情
export function getDeptDetail(id) {
    return request({
        url: `/company/department/${id}`,
    })
}
// 根据id修改部门详情
export function updateDepartment( data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}